package com.happystreet.info
{
	import com.adobe.serialization.json.JSON;
	
	import flash.utils.Dictionary;

	public class JobInfo
	{
		private const REWARD_TYPE_NAME_INDEX:int = 0;
		private const REWARD_TYPE_SYMBOL_INDEX:int = 1;
		private const REWARD_VALUE_INDEX:int = 1;
		private const REWARD_TYPE_INDEX:int = 0;
		
		public var levelMax:int;
		public var type:String;
		public var symbolName:String;
		public var name:String;
		public var costs:Array;
		private var xpRefForSearch:int;
		public var levelThresholds:Array;
		public var id:int;
		public var levelUpRewards:Array;
		public var earnings:Array;
		public var action:String;
		
		public function JobInfo(_arg1:XML, _arg2:Dictionary)
		{
			this.id = _arg1.@id;
			this.type = _arg2[String(_arg1.@type)][this.REWARD_TYPE_NAME_INDEX];
			this.symbolName = _arg1.@symbol;
			this.name = _arg1.@name;
			this.levelThresholds = JSON.decode(_arg1.@levels);
			this.levelMax = (this.levelThresholds.length + 1);
			this.costs = JSON.decode(_arg1.@costs);
			this.earnings = JSON.decode(_arg1.@earnings);
			this.levelUpRewards = JSON.decode(_arg1.@levelUpRewards);
			this.action = _arg1.@action;
		}
	}
}